﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>变频器维保记录录入</title>
	<meta name="viewport"  content="width=device-width, initial-scale=1">
	<link rel="stylesheet" type="text/css" href="${path}/resource/plugins/bootstrap/css/bootstrap.min.css">
  	<link rel="stylesheet" type="text/css" href="${path}/resource/css/ysrmain.css">
    <link rel="stylesheet" href="${path}/resource/css/gzfx.css">	    
    <link rel="stylesheet" href="${path}/resource/css/records.css">
    <script type="text/javascript" src="${path}/resource/plugins/jQuery/jquery-2.2.3.min.js"></script>
	<script type="text/javascript" src="${path}/resource/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="${path}/resource/js/echarts.min.js"></script>
</head>
<body>
	
	<!-- 头部 -->
	<!-- 开始 -->
	<jsp:include page="./top_nav.jsp"></jsp:include>
	<!-- 头部结束 -->
	
	
	
    <!-- 右侧内容区域 -->
    <div class="right-content container-fluid ">
    	<div class="row">
    		<!-- 主要图表区域 -->
            
   		<div class="head-w">变频器消息推送</div>
   		<div class="cont-condition">
			<div class="send-head">
				<div class="send-btn col-sm-2">
					<button onclick="send();">
						发送
					</button>
				</div>
				<div class="send-name col-sm-10">
					<div>
						<label class="center">收件人</label><input id="receiver" type="text" class="back-m1 color-w" placeholder="请输入收件人邮箱,多人用 ' ; ' 隔开">
					</div>
					<span class="send-no"></span>
					<div>
						<label class="center">主题</label><input id="mailtheme" type="text" class="back-m1 color-w" placeholder="请输入邮件主题">
					</div>
				</div>
			</div>
			<div class="send-content">
				<textarea id="mailcontent"  placeholder="请输入邮件内容	"></textarea>
			</div>
			
   		</div>
   		
   
	   </div>
    </div>
</body>
<script type="text/javascript">
$(function(){
	$(".menu-left").children("dl").eq(3).addClass("dl-active");
	
})

function send() {
	$.ajax({
		type : 'POST',
		url : '<%=path%>/monitor/managermesspush',
		data : {
			receiver : $('#receiver').val(),
			mailtheme : $('#mailtheme').val(),
			mailcontent : $('#mailcontent').val()
		},
		dataType : 'json',
		async : false,
		success : function(result) {
			if(result.status == 'OK') {
				if(result.data != null && result.data.resultCode == "1") {
					alert(result.data.resultMessage);
					window.location.href = '${path}/monitor/redirect/sendMsg';
				} else {
					alert(result.data.resultMessage);
				}
			} else {
				alert("邮件发送失败！");
			}
		}
	});
}

</script>
</html>
